[]
        
(Showing Draft Content)

dashboard.VisualNS.FilterService

类: FilterService

dashboard.VisualNS.FilterService

Table of contents

构造方法

方法

构造方法

constructor

new FilterService()

方法

applyFilter

applyFilter(filter): any

此方法用于调用筛选器。

参数

名称 类型
filter BasicFilter | TupleFilter | AdvancedFilter

返回值

any

示例代码

dom.addEventListener('click', (e) => {
	const it = e.target as HTMLLIElement;
	if (it.hasAttribute('data-value')) {
		const val = it.dataset.value;
		if (this.filter.contains(val)) {
			this.filter.remove(val);
		} else {
			this.filter.add(val);
		}
		host.filterService.applyFilter(this.filter);
	} else if (it.getAttribute('data-role') === 'toggle') {
		this.filter.setOperator(this.filter.getOperator() === Enums.BasicFilterOperator.In ? Enums.BasicFilterOperator.NotIn :Enums.BasicFilterOperator.In);
 	host.filterService.applyFilter(this.filter);
	}
})

clean

clean(): any

清除所有筛选器

返回值

any